/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;

/**
 *
 * @author Ben
 */
public class ControlTrail extends AbstractControl
{
    protected Spatial myNode;
    protected Spatial followNode;
    protected int offset = 25;
    public ControlTrail(Spatial a, Spatial b, int c)
    {
        myNode = a;
        followNode = b;
        offset = c;
    }
    
    @Override
    protected void controlUpdate(float tpf)
    {
        Vector3f vec = followNode.getLocalTranslation();
        Vector3f vec2 = new Vector3f(vec.x,vec.y+offset,vec.z);
        myNode.setLocalTranslation(vec2);
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp)
    {
        
    }

    public Control cloneForSpatial(Spatial spatial)
    {
        return null;
    }
    
}
